import axios from '@/plugins/axios';
const BASE_API = import.meta.env.VITE_APP_BASE_APIURL as string;

import { CommontTypes, ResponseVo} from '@/type';

export namespace PermissionService {
  export const pagePermission = async (data:any & CommontTypes.IPaginationParam): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/permission/findPermissionByCondition',data,{baseURL: BASE_API});
    return res;
  };

  export const addPermission = async (data:any): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/permission/add',data,{baseURL: BASE_API});
    return res;
  };


  export const updatePermission = async (data:any): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.post('/permission/edit',data,{baseURL: BASE_API});
    return res;
  };

  export const deletePermission = async (id:string|number): Promise<ResponseVo<any>> => {
    let res:ResponseVo<any> = await axios.get('/permission/delete',{params:{id},baseURL: BASE_API});
    return res;
  };

}
